package test;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-03-30
 * Time: 15:59
 */
class UnusualAdd {//不使用+-，达成相加的效果
    public int addAB(int A, int B) {
        // write code here
        int C = 0;
        while (B != 0) {
            C = (A & B) << 1;
            A ^= B;
            B = C;
        }
        return A;
    }
}
public class Main {

}
